package API.Collection.Set.BasicMethod;

import java.util.Set;
import java.util.TreeSet;

public class All {
    public static void main(String[] args) {
        Set<Integer> set = new TreeSet<>();
        System.out.println("此处应为true    " + set.add(1));
        System.out.println("此处应为false   " + set.add(1));
        set.add(2);
        System.out.println(set);
        set.remove(2);
        System.out.println(set);
        set.remove(2);
        set.add(2);
        set.add(3);
        System.out.println("此处应为true    " + set.contains(2));
        System.out.println(set.size());
        System.out.println("此处应为false   " + set.isEmpty());
        set.clear();
        System.out.println("此处应为true    " + set.isEmpty());
    }
}
